//---------------------------------------------------------------------------- // File: C3DScreen.h // Class: C3DScreen // Type: 3D Object // Author: Ken Anderson // Date: 5/23/05 // OS dependant: NA // Desc: Provides a screen, which is three dimensional, or an overlay, which // is two dimensional, for displaying blocks of text. // // Versions: 1.0 // Required headers: // 1) C3DFont.h -- Contains the C3D font used to display text in the 3d world. // 2) C3DQuad.h -- Contains a quad that can be used to overlay the screen. // 3) CTextPage.h -- Allows the management of Pages of Text objects. // 4) CText.h -- Allows the management of CText objects. //---------------------------------------------------------------------------- #ifndef __C3DSCREEN__ #define __C3DSCREEN__ /////////////// // INCLUDES // /////////////// #include "C3DFont.h" #include "C3DQuad.h" #include "Common.h" class C3DScreen { protected: //Dimensions of the screen. float m_fX, m_fY, m_fZ; float m_fHeight, m_fWidth; //Buffer management string m_sCmdLine; private: //Properties of the screen. bool m_bTransformed, m_bVisible; Byte m_byAlpha; unchar m_cCursor, m_cPrompt; //Page Management. long lNumPages, lCurrPage; //Buffer management C3DFont* m_pfntHistory; C3DFont* m_pfntCurrLine; C3DQuad* m_pLayer; vector m_vsPage; public: C3DScreen(); C3DScreen(const C3DScreen& screen); /////////////////////////////////////////////////////////////////////////////////////////////////////// // Name: Destructor // Date: 5/23/05 // Type: Common 3D Object. // Desc: Cleans up & destroys member variables. // Parameters: None // Return value: None ////////////////////////////////////////////////////////////////////////////////////////////////////// ~C3DScreen(){Destroy();} //Core functions virtual C3DERR Create(float x=0.0f, float y=0.0f, float z=0.0f, float fWidth=0.0f, float fHeight=0.0f, bool bTransformed=true, Byte byAlpha=255, PC3DFONTPROP pfp=NULL); void Destroy(); C3DERR Render(float fSysTime); //Font & Text Controls C3DERR SetFont(string sFontName="Arial", int nHeight=12, bool bBold=false, bool bItalic=false); int Print(string& s); //int Print(cstr str); void Clear(); void ClearCommandLine(); void ClearHistory(); //Layer Properties. C3DERR SetLayerTexture(string& s); void ClearLayer(); void ColorLayer(Dword dwBL, Dword dwTL, Dword dwTR, Dword dwBR); //Reminder: B = Bottom, L = Left, R = Right, T = Top //Screen Appearence and behavior. void SetPosition(float x, float y, float z); void SetDimensions(float fWidth, float fHeight); void SetVisible(bool bVisible=true); void SetAlpha(Byte byAlpha=255); void SetCursor(unchar chCursor='_'); void SetPrompt(unchar chPrompt='>'); //To be implemented// /* C3DERR SetLayerTexture(C3DTexture* pTexture); void SetTransformed(bool bTransformed=true); bool IsTransformed(); */ //Screen Properties. bool IsVisible(); Byte GetAlpha(); unchar GetCursor(); unchar GetPrompt(); //Events void OnChar(unchar ch); protected: void UpdateHistoryDisplayBuffer(); void UpdateCommandDisplayLine(); void RedrawDisplay(); }; #endif